@@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>文章分类管理</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-3">
                                <#NameCon id="condition" name="名称" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="Type.search()"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TypeTableToolbar" role="group">
                            @@if(shiro.hasPermission("/article/type/add")){
                                <#button name="添加" icon="fa-plus" clickFun="Type.openAddType()"/>
                            @@}

                            @@if(shiro.hasPermission("/article/type/delete")){
                                <#button name="删除" icon="fa-remove" clickFun="Type.deleteMore()" space="true"/>
                            @@}
                        </div>
                        <#table id="TypeTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/article/type/type.js?a"></script>
<script>
    //beetl没法解析js标签里面的 shiro模板 因此只能移到html里面
    function operateFormatter (value, row, index) {
        var id = row.id;

        var operateBtn = new Array();

	    @@if(shiro.hasPermission("/article/type/update")){
            operateBtn.push('<a class="btn btn-xs btn-primary btn-update" data-id="' + id + '" onclick=\"Type.openTypeDetail('+id+')\"><i class="fa fa-edit"></i>编辑</a> ');
		@@}

		@@if(shiro.hasPermission("/article/type/delete")){
            operateBtn.push(' <a class="btn btn-xs btn-danger btn-remove" data-id="' + id + '" onclick=\"Type.delete('+id+')\"><i class="fa fa-trash-o"></i>删除</a> ');
		@@}
        return operateBtn.join('');

    } ;
</script>
@@}
